package org.gongliang.jsmile.config.oss;

import org.gongliang.jsmile.config.oss.cloud.AliyunService;
import org.gongliang.jsmile.config.oss.cloud.NginxService;
import org.gongliang.jsmile.config.oss.cloud.QiniuService;
import org.gongliang.jsmile.config.oss.constants.OSSCanstant;

/**
 * 文件上传Factory
 * 
 * @author 亮仔
 */
public final class OSSFactory {

	public static OSSService build() {
		OSSConfig config = OSSConfig.me();
		if (config.getActive().equals(OSSCanstant.OSS_ALIYUN)) {
			return new AliyunService();
		}  else if (config.getActive().equals(OSSCanstant.OSS_QINIU)) {
			return new QiniuService();
		} else if (config.getActive().equals(OSSCanstant.OSS_NGINX)) {
			return new NginxService();
		}
		return null;
	}
}
